<template>
	<view class="detail">
		<view class="card">
			<view class="list flex">
				<view class="left flex">
					<image src="/static/mobile.png" mode="widthFix"></image>
					联系电话
				</view>
				<input type="number" class="right" placeholder="请输入您的联系电话" v-model="phone" disabled>
			</view>
			<view class="list flex">
				<view class="left flex">
					<image src="/static/chezuo.png" mode="widthFix"></image>
					预定人数
				</view>
				<text class="right">1人</text>
			</view>
			
		<!-- 	<view class="list flex">
				<view class="left flex">
					<image src="/static/date.png" mode="widthFix"></image>
					时间
				</view>
				<input type="number" class="right" placeholder="">
			</view> -->
			
			<view class="list flex">
				<view class="left flex">
					<image src="/static/pos-e1.png" mode="widthFix"></image>
					<view>
						<view>上车点</view>
						<view>(留言)</view>
					</view>
				</view>
				<input type="text" class="right" placeholder="例:XXX路口" v-model="location">
			</view>
		</view>
		<button class="edit flex-center" @click="submitForm">确定修改</button>
		<button class="cancle flex-center" @click="goBack">关闭</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isChecked:false,
				id:0,
				location:'',
				phone:''
			};
		},
		onLoad(options) {
			uni.setNavigationBarTitle({
				title:options.title
			})
			this.id = options.id;
			this.phone = uni.getStorageSync('phone')
		},
		methods:{
			submitForm(){
				uni.showModal({
					content:'是否确定修改？',
					confirmColor:'#4CD964',
					success:r=>{
						if(r.confirm){
							this.$https.post('',{
								apply_id:this.id,
								location:this.location
							}).then(res=>{
								uni.showToast({
									title:'修改成功',
									icon:'none'
								})
								uni.navigateBack({
									delta:1
								})
							})
						}
					}
				})
				
			},
			goBack(){
				uni.navigateBack({
					delta:1
				})
			}
		}
	}
</script>

<style lang="less">
	page{
		background: #f2f3f4;
	}
	@color: #4CD964;
	.detail{
		padding: 30rpx;
		.card{
			background: white;
			border-radius: 15rpx;
			padding: 10rpx 20rpx;
			.list{
				padding: 20rpx 0;
				font-size: 30rpx;
				border-bottom: 1rpx solid #f2f3f4;
				.left{
					width: 250rpx;
					font-weight: bold;
					image{
						width: 40rpx;
						height: auto;
						margin-right: 15rpx;
					}
				}
				.right{
					width: 450rpx;
					font-size: 28rpx;
					color:#333;
				}
				text{
					font-size: 28rpx;
					color:#666;
				}
				navigator{
					color:@color
				}
			}
			
		}
		.edit{
			margin: 40rpx 0 30rpx;
			background: @color;
			color:white;
		}
	}
</style>
